package com.sky.context;

// 用于保存和获取当前用户id
public class BaseContext {
//在sky-server模块的interceptor文件里的JwtTokenAdminInterceptor类中的preHandle()方法有引用过
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
